package org.example.service.bonus.impl;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.example.controller.rep.BonusListRep;
import org.example.controller.req.CurrencyHistoryReq;
import org.example.dao.bonus.BonusDao;
import org.example.dao.currency.CurrencyExchangeRateDao;
import org.example.dao.currency.CurrencyMsgDao;
import org.example.entity.bonus.BonusEntity;
import org.example.entity.currency.CurrencyExchangeRateEntity;
import org.example.entity.currency.CurrencyMsgEntity;
import org.example.service.bonus.BonusService;
import org.example.service.currency.CurrencyExchangeRateService;
import org.example.service.currency.CurrencyService;
import org.example.service.utils.Constant;
import org.example.service.utils.okhttp.OkHttpClients;
import org.example.service.utils.okhttp.OkHttpParam;
import org.example.service.utils.okhttp.OkhttpResult;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;
import java.util.stream.Collectors;

@Slf4j
@Service
public class BonusServiceImpl extends ServiceImpl<BonusDao, BonusEntity> implements BonusService {


    @Override
    public List<BonusListRep> lists() {
        List<BonusListRep> list = new ArrayList<>();
        List<BonusEntity> bonusEntities = baseMapper.selectList(null);
        bonusEntities.forEach(obj->{
            BonusListRep bonusListRep = new BonusListRep();
            BeanUtil.copyProperties(obj,bonusListRep);
            list.add(bonusListRep);
        });
        return list;
    }
}
